package com.zhang.service.impl;

import com.zhang.entity.Blog;
import com.zhang.mapper.BlogMapper;
import com.zhang.service.BlogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张立松
 * @since 2023-03-31
 */
@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {

    @Autowired
    BlogMapper blogMapper;

    @Override
    public Boolean updateUserInfo(Long userId, String column, String value) {
        if(column.equals("user_nickname")){
            return blogMapper.updateUserNickname(userId,value);
        }else if(column.equals("user_avatar")){
            return blogMapper.updateUserAvatar(userId,value);
        }else {
            return false;
        }
    }
}
